package com.dragon.modules.yuegou.query.act;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.act.GiftBagEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 礼包表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2020-08-05 15:47:18
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class GiftBagQuery extends GiftBagEntity implements Query<GiftBagEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 礼包名称查询条件 */
	@JsonUnwrapped(prefix = "bagName")
	private Condition<String> bagNameCondition;

    /** 备注查询条件 */
	@JsonUnwrapped(prefix = "remark")
	private Condition<String> remarkCondition;

    /** 排序查询条件 */
	@JsonUnwrapped(prefix = "sort")
	private Condition<Integer> sortCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "spuId")
	private Condition<String> spuIdCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "skuId")
	private Condition<String> skuIdCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public GiftBagQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public GiftBagQuery(GiftBagEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public GiftBagQuery(GiftBagQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.bagNameCondition != null) {
			this.bagNameCondition = other.bagNameCondition.copy();
		}
		if(other.remarkCondition != null) {
			this.remarkCondition = other.remarkCondition.copy();
		}
		if(other.sortCondition != null) {
			this.sortCondition = other.sortCondition.copy();
		}
		if(other.spuIdCondition != null) {
			this.spuIdCondition = other.spuIdCondition.copy();
		}
		if(other.skuIdCondition != null) {
			this.skuIdCondition = other.skuIdCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
	}

	@Override
	public QueryWrapper<GiftBagEntity> toQueryWrapper() {
		QueryWrapper<GiftBagEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (bagNameCondition != null) {
			bagNameCondition.toWrapper(wrapper, COL_BAG_NAME);
		}
		if (remarkCondition != null) {
			remarkCondition.toWrapper(wrapper, COL_REMARK);
		}
		if (sortCondition != null) {
			sortCondition.toWrapper(wrapper, COL_SORT);
		}
		if (spuIdCondition != null) {
			spuIdCondition.toWrapper(wrapper, COL_SPU_ID);
		}
		if (skuIdCondition != null) {
			skuIdCondition.toWrapper(wrapper, COL_SKU_ID);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return busdIdCondition 查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return busdIdCondition 查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param busdIdCondition 查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回礼包名称查询条件
	 * 
	 * @return bagNameCondition 礼包名称查询条件
	 */
	public Condition<String> bagName() {
		this.bagNameCondition = new Condition<>();
		return this.bagNameCondition;
	}
	
	/**
	 * 获取礼包名称查询条件
	 * 
	 * @return bagNameCondition 礼包名称查询条件
	 */
	public Condition<String> getBagNameCondition() {
		return bagNameCondition;
	}

	/**
	 * 设置礼包名称查询条件
	 * 
	 * @param bagNameCondition 礼包名称查询条件
	 */
	public void setBagNameCondition(Condition<String> bagNameCondition) {
		this.bagNameCondition = bagNameCondition;
	}

	/**
	 * 构造并返回备注查询条件
	 * 
	 * @return remarkCondition 备注查询条件
	 */
	public Condition<String> remark() {
		this.remarkCondition = new Condition<>();
		return this.remarkCondition;
	}
	
	/**
	 * 获取备注查询条件
	 * 
	 * @return remarkCondition 备注查询条件
	 */
	public Condition<String> getRemarkCondition() {
		return remarkCondition;
	}

	/**
	 * 设置备注查询条件
	 * 
	 * @param remarkCondition 备注查询条件
	 */
	public void setRemarkCondition(Condition<String> remarkCondition) {
		this.remarkCondition = remarkCondition;
	}

	/**
	 * 构造并返回排序查询条件
	 * 
	 * @return sortCondition 排序查询条件
	 */
	public Condition<Integer> sort() {
		this.sortCondition = new Condition<>();
		return this.sortCondition;
	}
	
	/**
	 * 获取排序查询条件
	 * 
	 * @return sortCondition 排序查询条件
	 */
	public Condition<Integer> getSortCondition() {
		return sortCondition;
	}

	/**
	 * 设置排序查询条件
	 * 
	 * @param sortCondition 排序查询条件
	 */
	public void setSortCondition(Condition<Integer> sortCondition) {
		this.sortCondition = sortCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return spuIdCondition 查询条件
	 */
	public Condition<String> spuId() {
		this.spuIdCondition = new Condition<>();
		return this.spuIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return spuIdCondition 查询条件
	 */
	public Condition<String> getSpuIdCondition() {
		return spuIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param spuIdCondition 查询条件
	 */
	public void setSpuIdCondition(Condition<String> spuIdCondition) {
		this.spuIdCondition = spuIdCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return skuIdCondition 查询条件
	 */
	public Condition<String> skuId() {
		this.skuIdCondition = new Condition<>();
		return this.skuIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return skuIdCondition 查询条件
	 */
	public Condition<String> getSkuIdCondition() {
		return skuIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param skuIdCondition 查询条件
	 */
	public void setSkuIdCondition(Condition<String> skuIdCondition) {
		this.skuIdCondition = skuIdCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdTimeCondition 查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdByCondition 查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

}
